<?php
class Producto
{
	public function __construct()
	{
		$dbhost = 'localhost';
		$dbuser = 'root';
		$dbpass = 'yonatan198414';
		//$dbname = 'fpproduccion';
		$dbname = 'fpproduccion';
		
		mysql_connect($dbhost,$dbuser,$dbpass);
		mysql_select_db($dbname);
	}
	
	public function BuscarRepuesto($nombre)
	{
		$datos = array();
		//$sql = "select * from clientes where CliRSocial LIKE '%$nombre%'";
		$sql = "select * from Producto where ProNombre LIKE '%$nombre%'";
		$res = mysql_query($sql);
		while($row = mysql_fetch_array($res,MYSQL_ASSOC))
		{
			$datos[] = array("value"=>$row['ProNombre'],
							"id"=> $row['ProCod']);
		}
		return $datos;
	}
}
?>
